﻿using System;
using System.Collections;
using System.Data;

namespace DotNetNuke.Modules.UserDefinedTable
{


  public class DataTypeSeparator : DataType
  {
    public override void RenderValuesToHtmlInsideDataSet(DataSet ds, int ModuleId, bool noScript)
    {
      IEnumerator enumerator = null;
      try
      {
        enumerator = ds.Tables[DataSetTableName.Fields].Rows.GetEnumerator();
        while (enumerator.MoveNext())
        {
          DataRow current = (DataRow)enumerator.Current;
          if ((string)current[FieldsTableColumn.Type] == this.Name)
            current[FieldsTableColumn.Visible] = false;

        }
      }
      finally
      {
        if (enumerator is IDisposable)
          (enumerator as IDisposable).Dispose();

      }
    }

    public override bool IsSeparator
    {
      get
      {
        return true;
      }
    }

    public override string Name
    {
      get
      {
        return "Separator";
      }
    }

    public override bool SupportsNormalizeFlag
    {
      get
      {
        return true;
      }
    }


  }

}

